package apy.codecase.greendao.gen;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import apy.codecase.model.AppDaoModel;
import apy.codecase.model.DiaryDaoModel;
import apy.codecase.model.PswDaoModel;

import apy.codecase.greendao.gen.AppDaoModelDao;
import apy.codecase.greendao.gen.DiaryDaoModelDao;
import apy.codecase.greendao.gen.PswDaoModelDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig appDaoModelDaoConfig;
    private final DaoConfig diaryDaoModelDaoConfig;
    private final DaoConfig pswDaoModelDaoConfig;

    private final AppDaoModelDao appDaoModelDao;
    private final DiaryDaoModelDao diaryDaoModelDao;
    private final PswDaoModelDao pswDaoModelDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        appDaoModelDaoConfig = daoConfigMap.get(AppDaoModelDao.class).clone();
        appDaoModelDaoConfig.initIdentityScope(type);

        diaryDaoModelDaoConfig = daoConfigMap.get(DiaryDaoModelDao.class).clone();
        diaryDaoModelDaoConfig.initIdentityScope(type);

        pswDaoModelDaoConfig = daoConfigMap.get(PswDaoModelDao.class).clone();
        pswDaoModelDaoConfig.initIdentityScope(type);

        appDaoModelDao = new AppDaoModelDao(appDaoModelDaoConfig, this);
        diaryDaoModelDao = new DiaryDaoModelDao(diaryDaoModelDaoConfig, this);
        pswDaoModelDao = new PswDaoModelDao(pswDaoModelDaoConfig, this);

        registerDao(AppDaoModel.class, appDaoModelDao);
        registerDao(DiaryDaoModel.class, diaryDaoModelDao);
        registerDao(PswDaoModel.class, pswDaoModelDao);
    }
    
    public void clear() {
        appDaoModelDaoConfig.clearIdentityScope();
        diaryDaoModelDaoConfig.clearIdentityScope();
        pswDaoModelDaoConfig.clearIdentityScope();
    }

    public AppDaoModelDao getAppDaoModelDao() {
        return appDaoModelDao;
    }

    public DiaryDaoModelDao getDiaryDaoModelDao() {
        return diaryDaoModelDao;
    }

    public PswDaoModelDao getPswDaoModelDao() {
        return pswDaoModelDao;
    }

}
